package com.eksboot.proxy.dynamic4;

import com.eksboot.proxy.Target;
import com.eksboot.proxy.TargetImpl;
import com.eksboot.proxy.dynamic3.LogInterceptor;
import com.eksboot.proxy.dynamic3.TransactionInterceptor;

/**
 * DynamicProxyTest
 *
 * @author: chenfenghai
 * @version: 1.0
 * @date: 2021-05-25 14:52
 */
public class DynamicProxyTest4 {

    public static void main(String[] args) {
        Target target = new TargetImpl();

        InterceptorChain interceptorChain = new InterceptorChain();
        interceptorChain.addInterceptor(new LogInterceptor());
        interceptorChain.addInterceptor(new TransactionInterceptor());

        target = (Target) interceptorChain.pluginAll(target);
        target.execute(" HelloWord ");

    }
}
